/*
 * @Author: @yzcheng
 * @Date: 2021-04-14 14:23:07
 * @Version: 1.0
 * @LastEditors: @yzcheng
 * @Description:
 * @LastEditTime: 2021-07-08 15:39:46
 */
import { formData, get, post } from './require'

export function trace(params) {
  return get('/act/task/trace', {
    processInstanceId: params,
  })
}

export function queryFileStr(params) {
  return get('/flowFile/queryFileStr', {
    proDefId: params,
  })
}

export function current_trace(params) {
  return get('/act/task/current_trace', {
    processInstanceId: params,
  })
}

/**
 * 通过
 *
 * @export
 * @param {*} data
 * @return {*}
 */
export function completeTaskByVo(data) {
  return post('/act/task/completeTaskByVo', data)
}

/**
 * 退回起点
 *
 * @export
 * @param {*} data
 * @return {*}
 */
export function back_first(data) {
  return formData('/act/task/back_first', data)
}

/**
 * 退回上一步
 *
 * @export
 * @param {*} data
 * @return {*}
 */
export function back(data) {
  return formData('/act/task/back', data)
}

/**
 * 驳回
 * @param data
 * @returns {Promise<*>}
 */
export function reject(data) {
  return formData('/act/task/reject', data)
}

/**
 * 强制办结
 *
 * @export
 * @param {*} data
 * @return {*}
 */
export function over(data) {
  return formData('/act/task/over', data)
}

/**
 * 废弃
 *
 * @export
 * @param {*} data
 * @return {*}
 */
export function terminate(data) {
  return formData('/act/task/terminate', data)
}

/**
 *获取用户信息列表
 *
 * @export
 * @param {*} params
 * @return {*}
 */
export function requestUserList(params) {
  return get('/user', params)
}

/**
 *获取角色信息列表
 *
 * @export
 * @param {*} params
 * @return {*}
 */
export function requestRoleList(params) {
  return get('/role', params)
}

/**
 *获取机构信息列表
 *
 * @export
 * @param {*} params
 * @return {*}
 */
export function requestOrgList(params) {
  return get('/org', params)
}

/**
 *委派
 *
 * @export
 * @param {*} params
 * @return {*}
 */
export function delegateTask(params) {
  return post('/act/task/delegateTask', params)
}
/**
 *意见征询
 *
 * @export
 * @param {*} params
 * @return {*}
 */
export function opinionSave(params) {
  return post('/opinion/save', params)
}
/**
 *查询是否是意见征询状态
 *
 * @export
 * @param {*} params
 * @return {*}
 */
export function opinionComplete(params) {
  return get('/opinion/complete', params)
}
/**
 *添加意见
 *
 * @export
 * @param {*} params
 * @return {*}
 */
export function opinionAddComment(params) {
  return formData('/opinion/addComment', params)
}

/**
 *转办
 *
 * @export
 * @param {*} params
 * @return {*}
 */
export function trunTask(params) {
  return post('/act/task/trunTask', params)
}
/**
 * 获取流程信息接口
 *
 * @export
 * @param {*} params
 * @return {*}
 */
export function flow(params) {
  return get('/flow', params)
}
/**
 * 抄送
 *
 * @export
 * @param {*} params
 * @return {*}
 */
export function add(params) {
  return post('/copy-task/add', params)
}

//获取用户别名
export function getUserAlias(userList) {
  return get(`/user/getCName?${userList ? userList.join('&') : ''}`)
}
//获取空白用户用户别名
export function getBlankUserAlias(params) {
  return get(`/task-chain/queryOne`, params)
}
